/**
 * ClueSource枚举
 *
 * @author sxf
 * @email sxf02615@163.com
 * @date 2025/1/15
 */
package com.sxf.crm.enums;


import java.util.Arrays;

public enum ClueSource {
    TELEMARKETING("电话营销"),
    PHONE("电话"),
    WEBSITE("官网"),
    SOCIAL_MEDIA("社交媒体"),
    REFERRAL("客户推荐"),
    EXHIBITION("展会"),
    SEARCH_ENGINE("搜索引擎"),
    EMAIL_MARKETING("邮件营销"),
    PARTNER("合作伙伴"),
    OTHER("其他");

    private final String label;

    ClueSource(String label) {
        this.label = label;
    }

    public String getLabel() {
        return label;
    }

    public static ClueSource fromValue(String value) {
        if (value == null) {
            return null;    
        }
        return Arrays.stream(ClueSource.values())
            .filter(source -> source.name().equals(value))
            .findFirst()
            .orElse(null);
    }
}
